<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Java实训课程 - 统计</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script src="libs/handlebars.min.js"></script>
<script src="libs/getQueryString.js"></script>
<script src="libs/js.cookie-2.1.0.min.js"></script>
<script src="libs/jquery.backstretch.min.js"></script>
</head>
<body>

	<div class="container">
		<div class="row">
			<div class="page-header">
				<h2>
					<strong>图片</strong>
				</h2>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="col-md-8">
			<ul class="nav nav-pills">
				<li><a href="index.html">首页</a></li>
				<li><a href="#">用户：<span id="nickname"></span></a></li>
			</ul>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<hr />
			</div>
		</div>
	</div>
	<div class="panel panel-success">
		<div class="thumbnail">
			<img align="center" id="file" src="">
		</div>
		<button id="delfile">删除</button>
	</div>
</body>
<script type="text/javascript">
	$(function() {
		var id = getQueryString('id');
		console.log(id);
		var url = 'querydel.action?id=' + id;
		$.getJSON(url, function(res) {
			$('#file').attr('src',
					'upload/' + res[0].archive_id + '/' + res[0].name);
		})
		$('#delfile').click(function() {
			$.post('delfile.action', {
				id : id
			}, function(res, status) {
				if ('OK' == res) {
					alert('确定删除');
				}
				window.location.href = "index.html";
			});
		});
	})
</script>
<script type="text/javascript">
	$(function() {
		$.getJSON('querynick.action', function(res) {
			$('#nickname').text(res.nick);
		})
	})
</script>
<script type="text/javascript">
	$(function() {
		$.backstretch("image/3.jpg")
	})
</script>
</html>